<?php 
class RegisterController extends  CommonController{
	/*
	 * 注册
	 * */
	public function register(){
			//判断密码是否一致
			if($_POST['pwd']!=$_POST['pwded']){
				$this->error('密码不一致');
			}
			//将一个新用户插入到hd_user中
			$sql=M()->exec("INSERT INTO hd_user SET username = '".$_POST['username']."',passwd=md5('".$_POST['pwd']."')");
			//判断一下验证码，转大写
       		if(strtoupper($_POST['verify'])!=$_SESSION['code']){
       			$this->error('验证码不正确');
       		}
		$this->success('注册成功','index.php');
	}
	//注册
	public function code(){
		$code=new Code();
		$code->show();
	}
	
	
	
}
















 ?>